package com.bestcem.xm.om.dao.impl;

import com.bestcem.xm.om.dao.UserMmoduleDao;
import com.bestcem.xm.om.dao.mapper.UserMmoduleMapper;
import com.bestcem.xm.om.entity.UserMmodule;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;

/**
 * @author zhangfeng <feng.zhang@idiaoyan.com>
 * @version v1.0
 * @date 2022/6/22 14:48
 */
@Repository
public class UserMmoduleDaoImpl implements UserMmoduleDao {
    @Resource
    private UserMmoduleMapper userMmoduleMapper;

    @Override
    public UserMmodule queryById(String id) {
        return userMmoduleMapper.queryById(id);
    }

    @Override
    public List<UserMmodule> queryAllByLimit(UserMmodule userMmodule) {
        return userMmoduleMapper.queryAllByLimit(userMmodule);
    }

    @Override
    public long count(UserMmodule userMmodule) {
        return userMmoduleMapper.count(userMmodule);
    }

    @Override
    public int insert(UserMmodule userMmodule) {
        return userMmoduleMapper.insert(userMmodule);
    }

    @Override
    public int insertBatch(List<UserMmodule> entities) {
        return userMmoduleMapper.insertBatch(entities);
    }

    @Override
    public int insertOrUpdateBatch(List<UserMmodule> entities) {
        return userMmoduleMapper.insertOrUpdateBatch(entities);
    }

    @Override
    public int update(UserMmodule userMmodule) {
        return userMmoduleMapper.update(userMmodule);
    }

    @Override
    public int updateByCode(UserMmodule userMmodule) {
        return userMmoduleMapper.updateByCode(userMmodule);
    }

    @Override
    public int deleteById(String id) {
        return userMmoduleMapper.deleteById(id);
    }

    @Override
    public List<UserMmodule> listByIds(List<String> ids) {
        if (CollectionUtils.isEmpty(ids)) {
            return Collections.emptyList();
        }
        return userMmoduleMapper.listByIds(ids);
    }

    @Override
    public List<UserMmodule> listMmodule() {
        return userMmoduleMapper.listMmodule();
    }

    @Override
    public UserMmodule findOneByCode(String code) {
        return userMmoduleMapper.findOneByCode(code);
    }

    @Override
    public List<UserMmodule> listAllMmodule() {
        return userMmoduleMapper.listAllMmodule();
    }
}

